/**
 * 
 */
package info.niwota.web.apache;

import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;

import x.org.apache.http.entity.InputStreamEntity;

/**
 * Append content at the end of the stream
 * 
 * @author qiangli
 *
 */
public class AppendInputStreamEntity extends InputStreamEntity {
	private String s = null;
	public AppendInputStreamEntity(InputStream instream, long length, String s) {
		super(instream, length);
		this.s = s;
	}

	@Override
	public void writeTo(OutputStream outstream) throws IOException {
		super.writeTo(outstream);
		if (s != null) {
			outstream.write(s.getBytes());
		}
	}
}
